from sympy import *

x = Symbol('x')
y = Symbol('y')
z = Symbol('z')

ret = solve([
    2 * x + 3 * y + 4 * z - 16,
    3 * x + 1 * y + 2 * z - 17,
    3 * x + 4 * y + 1 * z - 23
], [x, y, z])

print(ret)